<!DOCTYPE html>


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Programming with OpenPACE &#8212; OpenPACE 1.0.3 documentation</title>
    
    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="_static/breathe.css" type="text/css" />
    <link rel="stylesheet" href="_static/bootswatch-3.3.6/flatly/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '1.0.3',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true,
        SOURCELINK_SUFFIX: '.txt'
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Python API to OpenPACE" href="python_api.html" />
    <link rel="prev" title="Usage of OpenPACE" href="usage.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">

  </head>
  <body role="document">
  
  <a href="https://github.com/frankmorgner/openpace"
     class="visible-desktop hidden-xs"><img
    id="gh-banner"
    style="position: absolute; top: 50px; right: 0; border: 0;"
    src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png"
    alt="Fork me on GitHub"></a>
  <script>
    // Adjust banner height.
    $(function () {
      var navHeight = $(".navbar .container").css("height");
      $("#gh-banner").css("top", navHeight);
    });
  </script>


  <div id="navbar" class="navbar navbar-default ">
    <div class="container">
      <div class="navbar-header">
        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="index.html">
          OpenPACE</a>
        <span class="navbar-text navbar-version pull-left"><b>1.0.3</b></span>
      </div>

        <div class="collapse navbar-collapse nav-collapse">
          <ul class="nav navbar-nav">
            
            
              <li class="dropdown globaltoc-container">
  <a role="button"
     id="dLabelGlobalToc"
     data-toggle="dropdown"
     data-target="#"
     href="index.html">Site <b class="caret"></b></a>
  <ul class="dropdown-menu globaltoc"
      role="menu"
      aria-labelledby="dLabelGlobalToc"><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="install.html">Download OpenPACE</a></li>
<li class="toctree-l1"><a class="reference internal" href="install.html#compiling-and-installing-openpace">Compiling and Installing OpenPACE</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="usage.html">Usage of OpenPACE</a></li>
<li class="toctree-l1"><a class="reference internal" href="protocols.html">Extended Access Control Specification</a></li>
</ul>
</ul>
</li>
              
                <li class="dropdown">
  <a role="button"
     id="dLabelLocalToc"
     data-toggle="dropdown"
     data-target="#"
     href="#">Page <b class="caret"></b></a>
  <ul class="dropdown-menu localtoc"
      role="menu"
      aria-labelledby="dLabelLocalToc"><ul>
<li><a class="reference internal" href="#">Programming with OpenPACE</a><ul>
<li><a class="reference internal" href="#using-openpace-in-c-c">Using OpenPACE in C/C++</a></li>
<li><a class="reference internal" href="#using-openpace-in-python">Using OpenPACE in Python</a></li>
<li><a class="reference internal" href="#using-openpace-in-ruby">Using OpenPACE in Ruby</a></li>
<li><a class="reference internal" href="#using-openpace-in-go">Using OpenPACE in Go</a></li>
<li><a class="reference internal" href="#using-openpace-in-java">Using OpenPACE in Java</a></li>
<li><a class="reference internal" href="#using-openpace-in-javascript">Using OpenPACE in Javascript</a></li>
</ul>
</li>
</ul>
</ul>
</li>
              
            
            
              
                
  <li>
    <a href="usage.html" title="Previous Chapter: Usage of OpenPACE"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; Usage of OpenPACE</span>
    </a>
  </li>
  <li>
    <a href="python_api.html" title="Next Chapter: Python API to OpenPACE"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">Python API to... &raquo;</span>
    </a>
  </li>
              
            
            
            
            
              <li class="hidden-sm"></li>
            
          </ul>

          
            
<form class="navbar-form navbar-right" action="search.html" method="get">
 <div class="form-group">
  <input type="text" name="q" class="form-control" placeholder="Search" />
 </div>
  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>
          
        </div>
    </div>
  </div>

<div class="container">
  <div class="row">
    <div class="col-md-12 content">
      
  <div class="section" id="programming-with-openpace">
<span id="bindings"></span><h1>Programming with OpenPACE<a class="headerlink" href="#programming-with-openpace" title="Permalink to this headline">¶</a></h1>
<div class="section" id="using-openpace-in-c-c">
<h2>Using OpenPACE in C/C++<a class="headerlink" href="#using-openpace-in-c-c" title="Permalink to this headline">¶</a></h2>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">The <a class="reference external" href="_static/doxygen/modules.html">OpenPACE API documentation</a>
has all details of the native C/C++ interface.</p>
</div>
<p>Here we have a small example in C:</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">Have a look at the <a class="reference external" href="https://frankmorgner.github.io/vsmartcard/npa/README.html">nPA Smart Card Library</a> <a class="footnote-reference" href="#id3" id="id4">[2]</a> for a more complex project
that uses the C Interface from OpenPACE.</p>
</div>
</div>
<div class="section" id="using-openpace-in-python">
<h2>Using OpenPACE in Python<a class="headerlink" href="#using-openpace-in-python" title="Permalink to this headline">¶</a></h2>
<p>Python bindings must be configured with <code class="xref std std-option docutils literal"><span class="pre">--enable-python</span></code>. They depend
on SWIG and Python.</p>
<p>In case of a non-standard installation of OpenPACE you might &#8211; in addition to
<span class="target" id="index-0"></span><code class="xref std std-envvar docutils literal"><span class="pre">LD_LIBRARY_PATH</span></code> &#8211; also need to setup the <span class="target" id="index-1"></span><code class="xref std std-envvar docutils literal"><span class="pre">PYTHONPATH</span></code>
environment variable.</p>
<p>Here is a sample script that shows how OpenPACE is accessed from Python:</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">Have a look at the <a class="reference external" href="https://frankmorgner.github.io/vsmartcard/virtualsmartcard/README.html">Emulator for the German Identity Card</a> <a class="footnote-reference" href="#id5" id="id6">[3]</a> for a more
complex project that uses the Python Interface from OpenPACE.</p>
</div>
<p>Unfortunately, OpenPACE&#8217;s Python bindings are currently poorly documented:</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="python_api.html">Python API to OpenPACE</a><ul>
<li class="toctree-l2"><a class="reference internal" href="python_api.html#pace-module">pace Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="python_api.html#module-pace_entity">pace_entity Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="python_api.html#module-chat">chat Module</a></li>
</ul>
</li>
</ul>
</div>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.8: </span>The SWIG bindings from <a class="reference external" href="http://pypace.sourceforge.net">pyPACE</a> <a class="footnote-reference" href="#id1" id="id2">[1]</a> have been integrated into OpenPACE.</p>
</div>
</div>
<div class="section" id="using-openpace-in-ruby">
<h2>Using OpenPACE in Ruby<a class="headerlink" href="#using-openpace-in-ruby" title="Permalink to this headline">¶</a></h2>
<p>Ruby bindings must be configured with <code class="xref std std-option docutils literal"><span class="pre">--enable-ruby</span></code>. They depend on
SWIG and Ruby.</p>
<p>Here is a sample script that shows how OpenPACE is accessed from Ruby:</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.9: </span>Added Ruby bindings.</p>
</div>
</div>
<div class="section" id="using-openpace-in-go">
<h2>Using OpenPACE in Go<a class="headerlink" href="#using-openpace-in-go" title="Permalink to this headline">¶</a></h2>
<p>Go bindings must be configured with <code class="xref std std-option docutils literal"><span class="pre">--enable-go</span></code>. They depend on SWIG
and <code class="docutils literal"><span class="pre">gccgo</span></code>.</p>
<p>Here is a sample program that shows how OpenPACE is accessed from Go:</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.9: </span>Added Go bindings.</p>
</div>
</div>
<div class="section" id="using-openpace-in-java">
<h2>Using OpenPACE in Java<a class="headerlink" href="#using-openpace-in-java" title="Permalink to this headline">¶</a></h2>
<p>Ruby bindings must be configured with <code class="xref std std-option docutils literal"><span class="pre">--enable-java</span></code>. They depend on
SWIG, a java compiler and the JNI developement headers. You may set the
<span class="target" id="index-2"></span><code class="xref std std-envvar docutils literal"><span class="pre">JAVAC</span></code> environment variable to your preferred Java compiler.</p>
<p>Here is a sample program that shows how OpenPACE is accessed from Java:</p>
</div>
<div class="section" id="using-openpace-in-javascript">
<h2>Using OpenPACE in Javascript<a class="headerlink" href="#using-openpace-in-javascript" title="Permalink to this headline">¶</a></h2>
<p>Technically the process for getting OpenPACE into Javascript is similar to
cross compiling. It is covered in <a class="reference internal" href="install.html#javascript-api"><span class="std std-ref">Compiling for Javascript</span></a></p>
<table class="docutils footnote" frame="void" id="id1" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id2">[1]</a></td><td><a class="reference external" href="http://pypace.sourceforge.net">http://pypace.sourceforge.net</a></td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id3" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id4">[2]</a></td><td><a class="reference external" href="https://frankmorgner.github.io/vsmartcard/npa/README.html">https://frankmorgner.github.io/vsmartcard/npa/README.html</a></td></tr>
</tbody>
</table>
<table class="docutils footnote" frame="void" id="id5" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id6">[3]</a></td><td><a class="reference external" href="https://frankmorgner.github.io/vsmartcard/virtualsmartcard/README.html">https://frankmorgner.github.io/vsmartcard/virtualsmartcard/README.html</a></td></tr>
</tbody>
</table>
</div>
</div>


    </div>
      
  </div>
</div>
<footer class="footer">
  <div class="container">
    <p class="pull-right">
      <a href="#">Back to top</a>
      
    </p>
    <p>
        &copy; Copyright 2012-2018 by Frank Morgner and Dominik Oepen.<br/>
    </p>
  </div>
</footer>
  </body>
</html>